%load dataforproject.mat

% generate train data
hellinger_tr_data = gen_data(X1train, X2train, 'hellinger');
L1_tr_data = gen_data(X1train, X2train, 'L1');
L2_tr_data = gen_data(X1train, X2train, 'L2');
tr_label = ytrain;

% genereate test data
hellinger_te_data = gen_data(X1test, X2test, 'hellinger');
L1_te_data = gen_data(X1test, X2test, 'L1');
L2_te_data = gen_data(X1test, X2test, 'L2');
te_label = ones(size(hellinger_te_data,1),1);

% normalize the data to [-1,1]. Test is normalized according to
% train data.
[hellinger_tr_data, norm_params] = norm_data(hellinger_tr_data);
[hellinger_te_data, ~] = norm_data(hellinger_te_data, norm_params);

[L1_tr_data, norm_params] = norm_data(L1_tr_data);
[L1_te_data, ~] = norm_data(L1_te_data, norm_params);

[L2_tr_data, norm_params] = norm_data(L2_tr_data);
[L2_te_data, ~] = norm_data(L2_te_data, norm_params);
dataFeatures = [hellinger_tr_data L1_tr_data L2_tr_data];
dataclass = tr_label;


%run adaboost
[classestimate,model]=adaboost('train',dataFeatures,dataclass,50);
length(find(classestimate==ytrain))
% run svm
%[~,ytest] = run_svm(tr_data, tr_label, te_data, te_label, 1, 1);
%save classestimate.mat classestimate